<template>
	<view class="integral" :style="'height:'+viewHeight+'px;'">
		<view class="head">
			<view class="title">
				当前积分
			</view>
			<view class="num">
				0
			</view>
		</view>
		<money-report :dataList="integralList" @changeTab="getTabIndex"></money-report>
		<u-empty marginTop="50%" :show="integralList.length==0"
			icon='https://file.shopro.top/imgs/empty/empty_goods.png' width="260" height="260" text="暂无数据~">
		</u-empty>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//可视高度
				viewHeight: 0,
				//积分数据
				integralList: [],
				tabIndex: 0
			}
		},
		onReady() {
			//获取屏幕高度
			uni.getSystemInfo({
				success: (res) => {
					this.viewHeight = res.windowHeight
				}
			})
		},
		methods: {
			//获取tab栏的下标
			getTabIndex(index) {
				this.tabIndex = index
				console.log(this.tabIndex)
			}
		}
	};
</script>
<style lang="scss" scoped>
	.integral {
		background-color: #F6F6F6;
	}

	.head {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		height: 24vh;
		color: #fff;
		background: linear-gradient(180deg, #fd630d, #ffa424);

		/* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
		.title {
			font-size: 36rpx;
		}

		.num {
			margin-top: 30rpx;
			font-size: 80rpx;
		}
	}
</style>